package jtk.project4.fleet.screen.tripInformationEquipment;

/*
* Author : Rio Dermawan 
* Date Created : 1-April-2011
* Date Modified : 6-April-2011
* Version : 1.1
* */

import java.awt.FlowLayout;

import jtk.project4.fleet.field.AddGeneralExpenseField;
import jtk.project4.fleet.field.TripInformationEquipmentField;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.button.PushButton;

public class TripInformationEquipmentView extends FormView {
	private PushButton saveButton;
	private PushButton cancelButton;

	@Override
	protected void init() {
		createFields();
		createLayout();	
		
	}

	private GroupControl createButtons() {
		GroupControl buttons = new GroupControl();
		buttons.setLayout(new FlowLayout(FlowLayout.RIGHT));
		buttons.addField(saveButton);
		buttons.addField(cancelButton);
		return buttons;
	}
	
	private GroupControl createForm() {
		GroupControl form = new GroupControl();
		form.addField(new TripInformationEquipmentField("Trip Information Equipment"), NORTH);
		form.addField(createButtons(), SOUTH);		
		return form;
	}
	
	private void createLayout() {
		addField(createForm());
	}
	
	private void createFields(){
		saveButton = new PushButton("saveAction");
		cancelButton = new PushButton("cancelAction");
	}
}